Skip to content

feat(genre-tree): expose the region lexicon itemId - #624

Merged
Andreas-Garcia merged 2 commits into
mainfrom
feature/region-lexicon-item-id
Dec 5, 2026
Merged

Andreas-Garcia merged 2 commits into
mainfrom
feature/region-lexicon-item-id

Conversation

@Andreas-Garcia

Copy link
Copy Markdown
Member

Closes #623.

What changes

  • Requires @behindthemusictree/grow-api >=0.1.0-next.17 (dev pin 0.1.0-next.17), whose zRegionMapGenresResponse adds itemId: the region map index's item ID, a QID or a LOCAL: graph ID (Resolve region map references through active genre graph identities grow-the-music-tree-api#716, #719). wikidataId stays as a deprecated alias.
  • useRegionGenreLexicon now declares its return type as the exported RegionGenreLexicon, whose entries are RegionGenreLexiconEntry. Before, tsup inlined the entry fields of the grow-api the package was built against into index.d.ts, so consumers on a newer grow-api did not see new fields (44.0.4 hid itemId from the frontend even though it parsed it at runtime).
  • New useRegionGenreLexicon.test.ts: parsing keeps itemId for LOCAL:region-q10690 and a QID, plus disabled, loading (query key, schema, infinite cache, abort signal), success and error states.
  • __fixtures__/grow/regionGenres.json recaptured from staging, which serves itemId.

Consumer migration

Consumers must install grow-api 0.1.0-next.17 or later. The frontend (BehindTheMusicTree/grow-the-music-tree-frontend#662, PR #663) already does, and can drop its local useRegionLexicon re-typing once it adopts this release.

Validation

pnpm lint, pnpm build, pnpm test (app-kit 82 files, app-kit-ui 50 files) pass. The built dist/genre-tree/index.d.ts declares useRegionGenreLexicon(...): RegionGenreLexicon. Playground e2e not run: its mock serves an empty lexicon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose the region map itemId in the shared lexicon hook

1 participant